<template>
    <Card>
        <Tabs type="card" v-model="munname" @on-click="changeTab">
            <TabPane name="name1" label="对帐列表">
                <billList ref="billList"></billList>
            </TabPane>
            <TabPane name="name2" label="生成记录">
                <recordsGenerated ref="recordsGenerated"></recordsGenerated>
            </TabPane>
        </Tabs>
    </Card>
</template>
<script>
    import billList from './components/billList.vue';
    import recordsGenerated from './components/recordsGenerated.vue';
    export default {
        components: {
            billList,
            recordsGenerated,
        },
        data(){
            return {
                munname: 'name1'
            };
        },
        mounted() {
            this.$refs.billList.initial(this.munname);
        },
        methods: {
            changeTab(e) {
                if(e == 'name1'){
                    this.$refs.billList.initial(e);
                }else if(e == 'name2'){
                    this.$refs.recordsGenerated.initial(e);
                }
            }

        }
    };
</script>